package com.yu.bean;

import java.util.Date;

import javax.validation.constraints.Pattern;

public class User {
    private Integer userId;
    
    //匹配任何非空字符开始
    @Pattern(regexp = "^\\S{6,20}$", message="密码长度为6-20位!")
    private String pwd;
    
    //  /w等价于 [a-zA-Z0-9_]
    //不能以下划线开始和结尾2-10个汉字或者2-10个汉字加英文组合，或者4-20位英文
    @Pattern(regexp = "^(?!_)(?!.*?_$)([a-zA-Z0-9_\\u4e00-\\u9fa5]{4,10}|[a-zA-Z0-9_]{1,2}[\\u4e00-\\u9fa5]{1,2}|[\\u4e00-\\u9fa5]{1,2}[a-zA-Z0-9_]{1,2}|[\\u4e00-\\u9fa5]{2,10}|[a-zA-Z0-9_]{4,20})$",message = "昵称不能以下划线开头或结尾，2-10个汉字或汉字和字母，或者4-20个英文字母！")
    private String userName;

    private Date regDate;

    private String sex;
    
    @Pattern(regexp = "^([a-z0-9_\\.-]+)@([\\da-z\\.-]+)\\.([a-z\\.]{2,6})$", message = "邮箱格式错误！")
    private String email;
    
    @Pattern(regexp = "^1\\d{10}$", message = "手机号格式错误！")
    private String phone;

    private String signiture;
    
    private String upic;

    public String getUpic() {
		return upic;
	}

	public void setUpic(String upic) {
		this.upic = upic == null ? null : upic.trim();
	}

	public Integer getUserId() {
        return userId;
    }

    public void setUserId(Integer userId) {
        this.userId = userId;
    }

    public String getPwd() {
        return pwd;
    }

    public void setPwd(String pwd) {
        this.pwd = pwd == null ? null : pwd.trim();
    }

    public String getUserName() {
        return userName;
    }

    public void setUserName(String userName) {
        this.userName = userName == null ? null : userName.trim();
    }

    public Date getRegDate() {
        return regDate;
    }

    public void setRegDate(Date regDate) {
        this.regDate = regDate;
    }

    public String getSex() {
        return sex;
    }

    public void setSex(String sex) {
        this.sex = sex == null ? null : sex.trim();
    }

    public String getEmail() {
        return email;
    }

    public void setEmail(String email) {
        this.email = email == null ? null : email.trim();
    }

    public String getPhone() {
        return phone;
    }

    public void setPhone(String phone) {
        this.phone = phone;
    }

    public String getSigniture() {
        return signiture;
    }

    public void setSigniture(String signiture) {
        this.signiture = signiture == null ? null : signiture.trim();
    }
}